<template>
  <div>
    <div slot="header" class="clearfix">
      <!-- <el-button style="margin-bottom: 10px;float:left;padding-right: 20px" type="primary">
        高级搜索
      </el-button> -->
      <el-button style="float: right; padding: 3px 0" type="text" icon="el-icon-refresh"  @click="Refresh">刷新</el-button>
    </div>
    <com-table :tableData="tableData" url="sjrz/log/iocontrol" keyName="LogIOControl" :has-data="hasData"
      :table-head-list="tableHeadList" :total-count="totalCount" :page-num="pageNum" :page-size="pageSize"
      :page-sizes="pageSizes" :table-loading="loading" :table-height="tableHeight" :is-show-select="false"
      :page-show="true" :handle-show="false" :merge-flag="false" :modifys="true" :baddtsd="false"
      @setSearchHeight="setTableHeight" @openDialog="openDialog" ref="comTable">
      <template slot-scope="scope">
        <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
        <el-button type="text" size="small">编辑</el-button>
      </template>
    </com-table>
  </div>
</template>
<script>
import ComTable from "../../components/table/comTable";
import axios from 'axios'

export default {
  name: "mabDevice",
  data() {
    return {
      pageNum: 1,
      pageSize: 50,
      pageSizes: [5, 10, 20, 50, 100],
      totalCount: 0,
      tableData: [

      ], // 表格数据
      options: [],
      tableHeight: "", // 表格高度
      dialogTitle: "",
      hasData: false,
      loading: false, // 数据加载状态遮罩
      checkList: [],
      tableHeadList: [
        {
          colDisabled: false,
          colHidden: true,
          colSearch: true,
          colSort: false,
          columnComment: "日志唯一标识",
          columnName: "UUID",
        },
        {
          colDisabled: false,
          colHidden: false,
          colSearch: true,
          colSort: false,
          columnComment: "登录用户",
          columnName: "LoginUser",
        },
        {
          colDisabled: false,
          colHidden: true,
          colSearch: true,
          colSort: false,
          columnComment: "责任人ID",
          columnName: "EmpId",
        },
        {
          colDisabled: false,
          colHidden: false,
          colSearch: true,
          colSort: false,
          columnComment: "责任人名称",
          columnName: "EmpName",
        },
        {
          colDisabled: false,
          colHidden: true,
          colSearch: true,
          colSort: false,
          columnComment: "部门ID",
          columnName: "DeptId",
        },
        {
          colDisabled: false,
          colHidden: false,
          colSearch: true,
          colSort: false,
          columnComment: "部门名称",
          columnName: "DeptName",
        },
        {
          colDisabled: false,
          colHidden: true,
          colSearch: true,
          colSort: false,
          columnComment: "部门全称",
          columnName: "FullDeptName",
        },

        {
          colDisabled: false,
          colHidden: false,
          colSearch: true,
          colSort: false,
          columnComment: "产生时间",
          columnName: "OpTime",
        },
        {
          colDisabled: false,
          colHidden: false,
          colSearch: true,
          colSort: false,
          columnComment: "日志内容",
          columnName: "Content",
        },
      ],
      dialogControl: false,
    };
  },
  components: {
    ComTable,
  },
  created() {
    this.setTableHeight()
    //this.getTableData()
  },
  methods: {
    //刷新
    Refresh() {
      this.getTableData()
    },
    getTableData() {
      this.$get(`/sjrz/log/iocontrol?page=${this.pageNum}&count=${this.pageSize}`).then(jsonData => {
        console.log(jsonData, "sss");
        this.tableData = jsonData.data.data.LogIOControl
        this.totalCount = jsonData.data.page.total
      })
    },
    // 修改
    openDialog(type, row) {
      console.log('aaa');
      this.$router.push({
        path: '/Modifyform',
        name: 'Modifyform',
        params: row
      });
    },
    dialogClosed() { },

    setTableHeight() {
      let clientHeiht =
        window.innerHeight || document.documentElement.clientHeight;
      this.tableHeight = clientHeiht - 160;
    },
  },
};
</script>

<style scoped>
.el-checkbox-group {
  display: flex;
  flex-direction: column;
}
.el-select {
  width: 100%;
}
.el-date-editor.el-input,
.el-date-editor.el-input__inner {
  width: 100%;
}
</style>